'use strict';

var menu = angular.module("menu", []);
menu.factory("menuService", ['$rootScope',function ($rootScope) {
  return {
    menuMap:null,
    currentMenu:null,
    setCurrentMenu:function(menuId){
      this.currentMenu = this.menuMap[menuId];
      $rootScope.menuHighlight = {};
      $rootScope.menuHighlight[menuId] = true;
      $rootScope.parentMenuHighlight = {};
      $rootScope.parentMenuHighlight[this.currentMenu.parentId] = true;
      $rootScope.currentMenu = this.currentMenu;
    }
  }

}]);

